package org.apache.solr.spelling;

import org.apache.lucene.analysis.Token;

public class SpellCheckCorrection {

    private Token original;
    private String originalAsString = null;
    private String correction;
    private int numberOfOccurences;

    public Token getOriginal() {
        return original;
    }

    public String getOriginalAsString() {
        if (originalAsString == null && original != null) {
            originalAsString = original.toString();
        }
        return originalAsString;
    }

    public void setOriginal(Token original) {
        this.original = original;
        this.originalAsString = null;
    }

    public String getCorrection() {
        return correction;
    }

    public void setCorrection(String correction) {
        this.correction = correction;
    }

    public int getNumberOfOccurences() {
        return numberOfOccurences;
    }

    public void setNumberOfOccurences(int numberOfOccurences) {
        this.numberOfOccurences = numberOfOccurences;
    }
}
